package com.aaa.mrcai.controller;

import com.aaa.mrcai.pojo.vo.EnrollVo;
import com.aaa.mrcai.result.AjaxResult;
import com.aaa.mrcai.service.EnrollService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

/**
 * Demo class
 *
 * @Author: Wang
 * @Date: Created in 21:05 2021/12/10
 */
@RestController
@RequestMapping("consumer")
public class EnrollController {
    @Autowired
    private EnrollService enrollService;



    @RequestMapping("enroll")
    public AjaxResult enroll (EnrollVo enrollVo){

        return enrollService.enroll(enrollVo);

//        <insert id="addUserLogin" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
//                insert into t_user_info(id) values(null)
//                </insert>
    }

    @RequestMapping("checkPhone")
    public AjaxResult checkPhone (String telephone){
        return enrollService.isTelephoneExists(telephone);
    }

    @RequestMapping("sendCode")
    public AjaxResult sendCode(String telephone){
       return enrollService.sendCode(telephone);
    }
}
